Quiz on TikTok API Design

Test your understanding of API design by taking what we have learned and tackling a new design problem.

In the preceding lessons, we designed an API for a YouTube streaming service. Let's apply our concepts via a quiz on a similar platform known as TikTok.

5

Our TikTok application should support live streaming, where creators have the option of going live from their devices and their followers can join the live stream and interact with them.

Note: Ideally, we would want our live stream to be:

  • Accessible to a huge majority of our users
  • Supported by all major browsers and should have Android and iOS support
  • Available at a high quality
  • Available with low latency

Take a look at the image below. The image shows the basic flow of live video streaming. The numbers 1 and 2 denote the different streaming protocols being used to ingest the video from the capture device and send it to the streaming server and the streaming server sending processed data to the CDN, respectively. Which streaming protocols would be the best for this use case?

Your Answer
A)
  1. RTMP
  2. HLS
Explanation

RTMP is widely used for ingesting live streaming with the help of different encoders. So, it would be useful for sending the raw video to the server.

HLS would be the best option for sending the video from the streaming server to the CDN. It provides the audience with ultra-high-quality streaming, and the stream is also secured. Furthermore, it is supported by all major browsers, as well as Android and iOS.

B)
  1. MPEG-DASH
  2. WebRTC
Explanation

MPEG-DASH is a great option that supports many streaming encoding formats. However, this protocol has very limited support by video streaming devices, which would be a huge detriment to our use case. It is also not supported by Apple devices, which would heavily impact our user base.

WebRTC is a very useful protocol that is used for web and video conferencing. It supports real-time latency, and it allows videos to travel to the client’s screen in almost real time.

However, this protocol has not been widely adopted and could lead to compatibility issues

C)
  1. RTMP
  2. MPEG-DASH
Explanation

RTMP is the correct option for sending data between the video capture device and the streaming server, because it is widely used for the ingestion of live video streaming.

MPEG-DASH is a valid option that supports many streaming encoding formats. However, this protocol is not supported by Apple devices, which would limit our user base. Hence, it is not the best option.

Question 5 of 55 attempted

YouTube API Design Evaluation and Latency Budget

Requirements of the Messenger API